package cn.smile.bean.entity.notebook;

import cn.smile.commons.domain.BaseDomain;
import cn.smile.commons.encrypt.EncryptTypeHandler;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serial;
import java.util.Date;

@EqualsAndHashCode(callSuper = true)
@Data
@TableName(value = "notebook", autoResultMap = true)
public class Notebook extends BaseDomain {
    @Serial
    private static final long serialVersionUID = 6569840861334204287L;

    /**
     * 用户ID
     */
    private String userId;

    /**
     * 记录时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    private Date recordDate;

    /**
     * 同步发送微信公众号标记(true-发布, false-不发布)
     */
    private Boolean publishWechatFlag = Boolean.FALSE;

    /**
     * 发布微信公众号标题
     */
    private String publishTitle;

    /**
     * 日记类型
     */
    private Integer recordTypeDic;

    /**
     * 日记内容
     */
    @TableField(value = "content", typeHandler = EncryptTypeHandler.class)
    private String content;

    /**
     * 微信发布状态(0-未发布, 1-发布中, 2-发布失败, 3-发布成功)
     *
     * @see cn.smile.commons.enums.wechat.WeChatPublishStatusEnum
     */
    private Integer publishStatus;

    /**
     * 微信发布错误信息
     */
    private String publishErrorMsg;

    /**
     * 微信草稿发布ID
     */
    private String publishId;

    /**
     * 微信文章ID
     */
    private String articleId;
}
